#include <iostream>
using namespace std;

void way_count1(int n, int m, int& count)
{
    // if(n == 0 && m == 0)
    //     return 1;
    
    if (n == 1)
    {
        count++;
        return;
    }
    else if(m == 1)
    {
        count++;
        return;
    }
    else 
    {
        way_count1(n - 1, m, count);
        way_count1(n, m - 1, count);
    }
}

int way_count2(int n, int m)
{
    // 到边界只有一种走法
    if(n == 1 || m == 1)
        return 1;

    return way_count2(n - 1, m) + way_count2(n, m - 1);
}

int main() 
{
    int n, m;
    cin >> n >> m;

    // int count = 0;
    // way_count1(n + 1, m + 1, count);
    // cout << count << endl;

    cout << way_count2(n + 1, m + 1) << endl;
    return 0;
}
